package com.lyj.mode.proxy.dynamic.jdk;

/**
 * 测试类
 * @author:liyajie
 * @createTime:2022/2/23 15:15
 * @version:1.0
 */
public class Test {
    public static void main(String[] args) {
        // 创建目标类
        TargetPhone targetPhone = new TargetPhone();
        // 创建代理类
        IPhone iPhone = (IPhone) new ProxyPhone(targetPhone).getProxyInstance();
        System.out.println(iPhone.getClass());
        // 通过代理类调用目标方法
        iPhone.sellPhone();
    }
}
